import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios';

axios.defaults.baseURL = 'http://localhost:3000';

axios.interceptors.request.use(function (config) {
  return config;
}, function (error) {
  return Promise.reject(error);
});

axios.interceptors.response.use(function (response) {
  alert('请求成功')
  return response;
}, function (error) {
  alert('请求失败')
  return Promise.reject(error);
});

const myInstance = axios.create({
  baseURL:'http://localhost:3000',

})

Vue.config.productionTip = false
Vue.prototype.$axios = axios
Vue.prototype.$myInstance = myInstance

Vue.use(ElementUI);

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
